﻿
CREATE proc [dbo].[proc_Product_GetItem]
(
	@Id int
)
as
	select 
	Id,
	Sort,
	CateOneId,
	(select title from Product_Category where Id=[Product].CateOneId) CateOneName,
	CateTwoId,
	(select title from Product_Category where Id=[Product].CateTwoId) CateTwoName,
	SupplierId,
	(select title from Supplier where Id=[Product].SupplierId) SupplierName,
	Title,
	CostPrice,
	SalePrice,
	Description,
	UpTime,xmfx,
	SCateOneId,
	(select Title from Finance_Subject_Parent where Id=[Product].SCateOneId) SCateOneName,
	SCateTwoId,
	(select Title from Finance_Subject_Parent where Id=[Product].SCateTwoId) SCateTwoName,
	SubjectId,
	(select Title from Finance_Subject where Id=[Product].SubjectId) SubjectName
	,ISNULL(flag,0) AS flag
	from Product where Id=@Id

